//下拉菜单
$(function () {
    $('.M').hover(function () {
            $(this).addClass('active');
        },
        function () {
            $(this).removeClass('active');
        });
});

//无刷新自定义导航名称
function change(id, choose) {
    document.getElementById(id).value = choose.options[choose.selectedIndex].title;
}

//判断值是否属于空或空字符
function isEmpty(val) {
    if (val == null || val == undefined || val == '') {
        return true;
    }
    if (val.replace(/(^s*)|(s*$)/g, "").length == 0) {
        return true;
    }
    return false;
}

//验证是否属于IP:端口号
function isIpPort(val) {
    var reg = /^(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9]):\d{0,5}$/;
    return reg.test(val);
}